# Palindrome Permutation: Given a string, write a function to check if it is a permutation of
# a palindrome. A palindrome is a word or phrase that is the same forwards and backwards, A
# permutation is a rearrangement of letters. The palindrome does not need to be limited to just
# dictionary words.

def permutationPalindrome(s1):
    s1_count = [0]*127
    
    for x in s1:
        s1_count[ord(x)] +=1
    
    for x in s1_count:
        one_count = 0
        if x%2 != 0:
            return False
        if x==1:
            one_count+=1
    if one_count >1:
        return False
    return True

print(permutationPalindrome('baba'))